package legumes.client.services.callbacks;

import legumes.client.services.LegumesServicesHelper;
import legumes.client.services.util.rpc.SequencableRPCCall;

public class IsStoreNameExistsCallback extends SequencableRPCCall<Boolean> {

	private boolean storeExists;
	private String storeName;
	
	public IsStoreNameExistsCallback(String storeName_){
		storeName = storeName_;
	}
	
	@Override
	protected void doCall() {
		LegumesServicesHelper.LEGUMES_SERVICES.isStoreNameExists(storeName, this);
	}

	public void onSuccess(Boolean storeExists_) {
		storeExists = storeExists_;
		callNext();
	}

	public boolean isStoreExists() {
		return storeExists;
	}
}
